﻿<%@ Page Title="售后记录" Language="C#" MasterPageFile="~/Wap/Shop/ShopSite.Master" AutoEventWireup="true" CodeBehind="ReturnsList.aspx.cs" Inherits="ZLCMS.Web.Wap.Shop.ReturnsList" %>
    <%@ Register src="Footer.ascx" tagname="Footer" tagprefix="uc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
    <style type="text/css">
	#nav li{ border-left:1px solid #ddd;box-sizing: border-box;  -webkit-box-sizing: border-box; -moz-box-sizing: border-box; border-bottom:1px solid #ddd;}
	#nav li:nth-child(1){ border-left:none;}
	#navFixed .ui-navbar ul li a.ui-btn-active{ color:#f9384d; border-bottom-color:#f9384d;}
	.orderList{ margin:0!important;}
	.orderList li{font-size:12px!important;}
	.orderList li span{font-size:12px!important; display:inline-block; padding:1px 6px;}
	.orderList li h2{ font-size:14px!important;}
	.orderList li .ui-btn-icon-right::after{ display:none;}
    </style>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="pages" runat="server">
<div data-role="page" id="mypage">

	<div data-role="header">
	</div><!-- /header -->

	<div role="main" class="ui-content">
        
    	<!--s nav-->
        <div id="navFixed" >
        <div id="nav">
        	<div data-role="navbar" nav="navFixed">
              <ul>
                <li><a href="ReturnablesList.aspx" data-theme="f" data-ajax="false">申请售后</a></li>
                <li><a href="ReturnsList.aspx" data-theme="f" data-ajax="false" class='ui-btn-active'">售后记录</a></li>
              </ul>
            </div>
        </div>
        </div>
        <!--e nav-->
        

       <ul class="listviewHandler ui-listview ui-listview-inset ui-corner-all ui-shadow orderList" data-inset="true" data-role="listview">
       </ul>

       <div style="display:none">
        <button id="btnMore" data-icon="refresh" style="width: 95%; margin-left: auto; margin-right: auto;">显示更多</button>
       </div>
        <!--s refundlist-->

        

        
  	</div><!-- /content -->
    
	<div data-role="footer" data-position="fixed" data-tap-toggle="false">
    
                <uc1:Footer ID="Footer1" runat="server" MenuId="M" />    
    </div>
    
</div>
    <script src="/wap/lib/common/listviewHandler.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(function () {
            queryData();
        });

        function queryData() {
            var param = $.extend({}, { MemberAccount: '<%=CurrentMemberAccount %>' });
            var handler = $('.listviewHandler').listviewHandler();
            handler.initialize({
                loaderBtn: $('#btnMore'), //加载数据按钮（点击加载下一页）
                emptyHtml: '<p class="more">-- 没有售后信息 --</p>', //无记录时显示此html
//                itemTemplate2: '<li data-role="list-divider" role="heading" class="ui-li-divider ui-bar-inherit ui-li-has-count">{RecordDate}'+
//                    '<span class="ui-li-count ui-body-inherit">{StatusText}</span></li>' +
//                    '<li class="ui-last-child"><a data-ajax="false" href="ReturnsProgress.aspx?rid={Id}" class="ui-btn ui-btn-icon-right ui-icon-carat-r">' +
//					'<h2>申请单号：{IdHtml}</h2>' +
//					'{ApplyObject}' +
//					'</a></li>',
                itemTemplate: '<div class="refund_list" data-ajax="false" onclick="location.href=\'ReturnsProgress.aspx?rid={Id}\'">'
                        	+ '<div class="title">'
                            + '<div class="left"><font>受理号：{IdHtml}</font><br/><span>提交时间：{RecordDate}</span></div>'
                            + '<div class="right">{StatusText}</div></div>'
                            + '<div class="box">{ApplyObject}</div>'
                        + '</div>', //项模板
                pageIndex: 1, //页码（从1起算）
                pageSize: 20, //页大小
                totalCount: 999, //总记录数
                itemHandler: function (data, itemTemplate, container) {//数据各项处理
                    data.StatusText = '无效';
                    if (data.CancelStatus == '1') {
                        data.StatusText = '[已取消]';
                    } else if (data.ConfirmStatus == '0') {
                        data.StatusText = '[待受理]';
                    } else if (data.ConfirmStatus == '1' && (data.ProcessStatus == '0' || data.ProcessStatus == '9')) {
                        data.StatusText = '[已受理][待处理]';
                    } else if (data.ProcessStatus == '1' && data.FinishStatus == '0') {
                        data.StatusText = '[已处理][待确认]';
                    } else {
                        data.StatusText = '[已完成]';
                    }

                    if (data.ProductNo) {

                        //data.ThumbnailImg = firstThumbnail(data.ThumbnailImg);
                        var temp = '<p>产品：{ProductName}</p>' + '<p>费用：￥{TotalPrice}</p>';
                        data.ApplyObject = temp.format(data);
                    } else {
                        data.ApplyObject = '<p>订单号：' + data.OrderNo + '</p><p>费用：￥' + data.TotalPrice + '</p>';
                    }

                    data.IdHtml = ("0000000000" + data.Id).substr(-10);

                    return itemTemplate.format(data);
                },
                command: 'Member.LoadReturnsList',
                parameter: param
            });
            handler.nextPage();
        }

        $(function () {
            $(window).scroll(function () {
                //当内容滚动到底部时加载新的内容

                if ($(this).scrollTop() + $(window).height() + 20 >= $(document).height() && $(this).scrollTop() > 20) {
                    //当前要加载的页码
                    $('#btnMore').click();
                }
            });
        });
    </script>
</asp:Content>
